package com.zxy.ziems.server.energy.controller;

import com.zxy.btp.common.response.JsonResponse;
import com.zxy.ziems.server.constant.enums.DictCodeEnum;
import com.zxy.ziems.server.dto.DataQueryDto;
import com.zxy.ziems.server.energy.service.DataChartDictService;
import com.zxy.ziems.server.vo.ChartVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 动力各科-电科
 *
 * @Copyright (C),
 * @ClassName: ElectricController
 * @Author: yanzhiwei
 * @Description:
 * @Date: 2024/6/18 14:49
 */
@RestController
@RequestMapping("/api/electric")
@Validated
public class ElectricController {

    @Autowired
    private DataChartDictService dataChartDictService;

    /**
     * 能源数据统计-本周期数据环（峰平谷）
     *
     * @param dataQueryDto
     * @return
     */
    @GetMapping("/compareBarChartEle")
    public JsonResponse<ChartVo> thisCycleData(DataQueryDto dataQueryDto) {
        dataQueryDto.setDictCode(DictCodeEnum.PEAK_FLAT_VALLEY.getCode());
        dataQueryDto.setItemName("峰平谷");
        ChartVo chartVo = dataChartDictService.compareBarChartEle(dataQueryDto);
        return JsonResponse.SUCCESS(chartVo);
    }
}
